package cn.sfinger.huifu.p2p.controller;

import java.util.Enumeration;

import javax.servlet.ServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import cn.sfinger.huifu.p2p.base.HuifuConstant;
import cn.sfinger.huifu.p2p.integration.HuifuIntegration;

/**
 * 汇付页面跳转回用户的入口
 * 
 * @author michael.wang.54@gmail.com
 * @version 1.0.0
 * @date 2015年12月10日
 */
@Controller
public class HuifuRedirectController {
	@Autowired
	private HuifuIntegration huifu;
	
	private static Logger logger= LoggerFactory.getLogger(HuifuRedirectController.class);
	
	@RequestMapping(value={"/redirect/huifu/SampleURL"})
	public String userRegisterAction(ServletRequest request){
		logger.info("[汇付页面转跳接口请求] {}", JSON.toJSONString(request.getParameterMap()));
				
		// 将VERIFY_KEYS_xxx针对不同的回调进行选择
		boolean checkResult= true;//huifu.verifySign(request, HuifuConstant.VERIFY_KYES_USER_REGISTER);
		
		request.setAttribute("returnResult", JSON.toJSONString(request.getParameterMap()));
		return "huifu_redirect";
	}
}
